#include "third-party/src/UnitTest++.h"
#include <stdlib.h>
#include "fileCreator.h"

using namespace std;

void creatingFile(const char* nameFile)
{
    FILE* testFile = FileCreator::getNewFile(nameFile);
    if (testFile)
        fclose(testFile);

    FILE* expected = fopen(nameFile, "r");
    if (expected)
    {
        CHECK(true);
        fclose(expected);
    }
    else
        CHECK(false);
}

//TEST(CreateFileSiceRoot)
//{
//    creatingFile("5bcde/0A060F26060F127D/ooo");
//}

//TEST(CreateFileInCurrentFolder)
//{
//    const char* file = "test/resources/log/directory/Log";
//    creatingFile(file);
//}

TEST(CreateFileSincePreviousDirectory)
{
    const char* file = "../../log";
    creatingFile(file);
    unlink(file);
}

TEST(CreateFileInCurrentDirectory)
{
    const char* file = "MyLog";
    creatingFile(file);
    unlink(file);
}
